﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace CSharpAlgorithm.Base
{
    struct GraphStruct
    {
        public int V;
        public int E;
        /// <summary>
        /// 방향인접행렬
        /// </summary>
        public int[,] DirectionMatrix;
        /// <summary>
        /// 무방향인접행렬
        /// </summary>
        public int[,] NonDirectionMatrix;
        /// <summary>
        /// 인접리스트
        /// </summary>
        public List<Edge>[] DirectionList;
        /// <summary>
        /// 변집합
        /// </summary>
        public Edge[] EdgeArray;

    }
    public class Edge : IComparable<Edge>
    {
        public int From;
        public int To;
        public int Cost;
        public int Cap;
        public int Rev;

        public Edge()
        {
        }
        public Edge(int from, int to, int cost, int cap, int rev)
        {
            From = from;
            To = to;
            Cost = cost;
            Cap = cap;
            Rev = rev;
        }

        public override string ToString()
        {
            return "From: " + From + ", To: " + To + ", Cost: " + Cost + ", Cap:" + Cap + ", Rev: " + Rev;
        }

        #region IComparable<Edge> Members

        public int CompareTo(Edge other)
        {
            return From - other.From;
        }

        #endregion
    }
    public struct Pair : IComparable<Pair>
    {
        public int First;
        public int Second;

        public Pair(int a, int b)
        {
            this.First = a;
            this.Second = b;
        }


        #region IComparable<Pair> Members

        public int CompareTo(Pair other)
        {
            return First - other.First;
        }

        #endregion
    }
}
